﻿using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Office.Interop.Word;

namespace WFL.Office.Word
{
    public class WordComments
    {
        public WordComment  this[int index]
        {
            get { return new WordComment(_comments[index]); }
        }

        public int Count
        {
            get { return _comments.Count; }
        }

        private Comments _comments;

        internal WordComments(Comments comments)
        {
            _comments = comments;
        }

        public WordComment Add(WordRange range, string text)
        {
            if (text == null)
            {
                return new WordComment(_comments.Add(range._range));
            }
            else
            {
                object objText = text;
                return new WordComment(_comments.Add(range._range, ref objText));
            }
        }
    }
}
